# encoding=utf8
import sys
reload(sys)
sys.setdefaultencoding('utf8')

class FT_05a0:
    result=[]
    analysisDecription = ['自定义消息体长度：','远程控制指令流水号：','远程控制指令状态：','随机码：']
    analysis05a0Length=[2,2,1,3]

    def LogicAisle(self, protocolStr, header):
        msglen=protocolStr[0:4]
        header.append(self.analysisDecription[0]+msglen+'\n')
        serial_num=protocolStr[4:8]
        header.append(self.analysisDecription[1] + serial_num + '\n')
        status=protocolStr[8:10]
        msg=''
        if status=='00':
            msg='请求有效'
            header.append(self.analysisDecription[2] +status + msg + '\n')
            tatted_code = protocolStr[10:16]
            header.append(self.analysisDecription[3] + tatted_code + '\n')
        elif status=='01':
            msg='指令未知'
            header.append(self.analysisDecription[2] + status + msg + '\n')
        elif status=='02':
            msg='同一模块指令请求有效时，附加发送随机码'
            header.append(self.analysisDecription[2] + status + msg + '\n')
        else:
            msg='预留'
            header.append(self.analysisDecription[2] + status + msg + '\n')
        self.result=header
